# coding: utf-8
__author__ = 'liuzhenhua'
import os


def find_files(f):
    files = os.listdir(f)
    for item in files:
        new_file = f+item
        if os.path.isdir(new_file):
            find_files(new_file+'/')
        else:
            in_file = open(new_file, 'r')
            count = 0
            for line in in_file:
                count += 1
                try:
                    line.decode('utf-8')
                except Exception:
                    print new_file +' 第:' + str(count)+'行'

root_url = raw_input("检查是否有乱码！！！请输入要检查的根路径，例如：E:/")
if root_url == '':
    root_url = "E:/android/workspace/Location/src/"
    print '没有输入跟目录'
else:
    find_files(root_url)
